package chpt06;

import java.util.ArrayList;
import java.util.List;

public class Course {
	private String name;	// 课程名称
	private int credit; 	// 课程学分
	private List<StudentV4> allStudents; // 选修某课的学生集合
	// getter/setter代码
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getCredit() {
		return credit;
	}
	public void setCredit(int credit) {
		this.credit = credit;
	}
	public List<StudentV4> getAllStudents() {
		return allStudents;
	}
	public void setAllStudents(List<StudentV4> allStudents) {
		this.allStudents = allStudents;
	}
	public Course() {
		this.allStudents = new ArrayList<StudentV4>();
	}
	public Course(String name,int credit) {
		this();
		this.setName(name);
        this.setCredit(credit);		
	}
	// toString方法
	@Override
	public String toString() {
		return "课程名称：" + this.name + "; 学分：" + this.credit;
	}
}
